﻿using System.DirectoryServices;

namespace Hx.ADSyncPlatform.ActiveDirectory.Model
{
    //hack：不应该属于Models
    /// <summary>
    /// 查询层级
    /// </summary>
    public enum SearchScopeDerivation
    {
        OneLevel = 1,
        Subtree = 2
    }

    public static class SearchScopeDerivationConvert
    {
        public static SearchScope Convert(this SearchScopeDerivation searchScope)
        {
            switch (searchScope)
            {
                case SearchScopeDerivation.OneLevel:
                    return SearchScope.OneLevel;
                case SearchScopeDerivation.Subtree:
                    return SearchScope.Subtree;
                default:
                    return SearchScope.OneLevel;
            }
        }
    }
}
